/*
 * 
 * Copyright 2010 David H Pollack
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License. 
 * 
 * 
 */

package com.dhpollack.rotogss.data;

import java.util.Date;
import java.util.List;
import java.util.Set;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

/**
 * @author davidpl
 *
 */
@PersistenceCapable
public class YahooLeagueTeamStandings {
	
    @PrimaryKey
    @Persistent
    private Key standingsKey;
    
    @Persistent(mappedBy = "standingskey")
    private Set<YahooLeagueTeamStandingStats> standingStats;
    
    @Persistent
    @Extension(vendorName = "datanucleus", key = "gae.unindexed", value="true")
    private Double teamPoints;

    @Persistent
    private Double teamPointsChange;

    @Persistent
    private Integer teamRank;

    @Persistent
    private Date timestamp;

    @Persistent
    private Key leagueKey;
    
    @Persistent
    @Extension(vendorName = "datanucleus", key = "gae.unindexed", value="true")
    private List<Key> statKeys;
    
    @Persistent
    @Extension(vendorName = "datanucleus", key = "gae.unindexed", value="true")
    private List<Double> statValues;
    
    @Persistent
    private YahooLeagueTeams teamkey;

	public Key getStandingsKey() {
		return standingsKey;
	}

	public void setStandingsKey(Key standingsKey) {
		this.standingsKey = standingsKey;
	}

	public Set<YahooLeagueTeamStandingStats> getStandingsStats() {
		return standingStats;
	}

	public void setStandingsStats(Set<YahooLeagueTeamStandingStats> standingsStats) {
		this.standingStats = standingsStats;
	}

	public void addStandingsStats(YahooLeagueTeamStandingStats standingsStat) {
		this.standingStats.add(standingsStat);
	}

	public void removeStandingsStats(YahooLeagueTeamStandingStats standingsStat) {
		this.standingStats.remove(standingsStat);
	}

	public Double getTeamPoints() {
		return teamPoints;
	}

	public void setTeamPoints(Double teamPoints) {
		this.teamPoints = teamPoints;
	}

	public Double getTeamPointsChange() {
		return teamPointsChange;
	}

	public void setTeamPointsChange(Double teamPointsChange) {
		this.teamPointsChange = teamPointsChange;
	}

	public Integer getTeamRank() {
		return teamRank;
	}

	public void setTeamRank(Integer teamRank) {
		this.teamRank = teamRank;
	}

	public Date getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(Date timestamp) {
		this.timestamp = timestamp;
	}

	public Key getLeagueKey() {
		return leagueKey;
	}

	public void setLeagueKey(Key leagueKey) {
		this.leagueKey = leagueKey;
	}

	public List<Key> getStatKeys() {
		return statKeys;
	}

	public void setStatKeys(List<Key> statKeys) {
		this.statKeys = statKeys;
	}

	public List<Double> getStatValues() {
		return statValues;
	}

	public void setStatValues(List<Double> statValues) {
		this.statValues = statValues;
	}

	public YahooLeagueTeams getTeamkey() {
		return teamkey;
	}

}
